Put a Carriage Return after each line in the fields
Create a Mousedown Handler
Read this if you're obsessive-compulsive
Read this if you're VERY picky.
Okay, fine.
Coordinating Fields against meddling
Multiscroll's third mode
Idle Handler
That's All
The Author
-- part contents for card part 3
----- text -----
0
1
2
3
4
5
6
7
8
9
10
11
12
13
-- part contents for card part 1
----- text -----
MultiScroll XCMD Version 1.0
••••••••
Multiple scrolling fields in HyperCard have been a pain
in the neck for me. All my HyperTalk attempts to
implement them have been slow and unMac-like. I was
thus motivated to create the Multiscroll XCMD.
••••••••
To use it, just line up the scrolling fields that you wish
linked so that they overlap and only one scrollbar is
showing. Make sure the wide margins and line height
are set the same in each field, and that the fields are
the same height.
••••••••
Next, create a transparent button which is exactly the
size of your remaining visible scrollbar, i.e., 17 pixels
wide and the height of the entire field. Make sure Show
Name and Auto Hilite are off. Place it directly over the
scrollbar. The idea here will be to use this button to
intercept mouse clicks and to have it handle the
scrolling via MultiScroll.
••••••••
MultiScroll will use the number of lines in the field in
its calculations, so you must make sure each line of
text has a carriage return after it. This is easy for
most things you would want multiple scrolling fields
for, but something like this text needs to be attended to
with intentional carriage returns, otherwise the field
will not scroll all the way down. This is only necessary
in the primary field (with the scrollbar showing). In
fact, you could make a dummy field with just carriage
returns in it and "underlap" it so just the scrollbar
was showing, instead of placing returns at the end of
each text line in this field.
••••••••
So create a MOUSEDOWN handler in the button's script.
Please take a look at the handler in the script of the
button overlying this scrollbar for an example. The
first parameter of Multiscroll must be the rect of the
button. All the rest represent the involved fields,
starting with the one whose scrollbar is being used.
Each field parameter should be enclosed in quotation
marks, and should contain two "sub-parameters." The
first is the field ID and the second is "card" or "bkgnd"
depending on the type of field (again, see this field's
button).
••••••••
For the true obsessive-compulsive, you will note that
in a real scrolling field, you get the arrow cursor when
you enter the scrollbar. Well, MultiScroll has another
mode using one parameter. The "Init" parameter will
give you the arrow cursor, and the "Uninit" parameter
will return you to the browse tool cursor. Use these
in mouseWithin and mouseLeave handlers respectively
in the scrollbar button.
••••••••
Note for the hopeless obsessive-compulsive: Unlike the
real thumb box, this one does nothing when there is a
single click in it with no dragging. Also, if you notice
the light grey scrollbar background shifting slightly
when you click on the thumb box, try widening or
reducing the width of the field by a few pixels. The
proper appearance of the top line of pixels in the light
grey portion of the scrollbar is 010001000100010.
Make sure you reposition the button to lie directly
over the scrollbar if you do this. If you don't know
what I'm talking about, then forget about it and rest
assured that you are mentally healthy.
••••••••
Okay, this setup will now simulate a single scrolling
field's actions nearly perfectly, except of course, the
arrows will scroll a little slower since the XCMD still
needs to set multiple scrolls, and this is slow in
HyperCard.
••••••••
Why am I still writing? Well, we still need to
coordinate the fields for when they are out of our
control, i.e., if some hapless user does a find command
and forces one field's scroll down. We want the other
fields to catch up. To this end, I have declared a global
variable named "initScroll" into which I put 0 on
openCard.
••••••••
MultiScroll has a third additional mode which is useful
here. If you put an integer instead of a rect in the first
parameter, it will set the scrolls to that integer. Take
a look at the openCard card script to see how we use
this to set the scrolls to 0 on openCard.
••••••••
Finally, I use this mode in an idle handler in the card
script which checks the fields against initScroll and
resets them if necessary. Notice that we also keep
initScroll updated from the scrollbar button script.
••••••••
That's all there is to it. Very simple compared to other
methods. This XCMD is free and in the public domain. I
would appreciate your crediting me in your stacks if
you use it since this little bit of narcissism is my only
reward.
••••••••
Oscar F. Hills
34 Maplewood Terrace
Hamden, CT 06514
(203) 287-1913
CIS => 73317,3005
GEnie => O.HILLS
-- part contents for card part 11
----- text -----
For those of you who have my automatic disk cataloging
stack, AutoCat 4.01 (or my primitive version, Auto Floppy Log), I would like to announce the planned release of AutoCat 5.0 towards the end of the summer, 1988 that is. The design is all new, and the stack is menu driven to reduce clutter. Multiscroll is just one of the many externals used to polish up AutoCat.
It will include printing and report generating externals which will allow the user to print out disk catalogs or send them to a file, or to search the entire collection extracting the selected items for printing or other purposes. Of course you'll still be able to do powerful searches, display a file's pathway graphically, and launch any file from the catalogs.
AutoCat 5.0 will be free to registered users of AutoCat 4.01, and may not be available by any other route since shareware fees don't even cover my phone bill at this point. Register today!